﻿@using DevM.Web.Models.Common.Modals
@model DevM.Web.Models.Projects.EditProjectModalViewModel
@{
    Layout = null;
}
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditProject")))

<div class="modal-body">
    <form name="ProjectEditForm" role="form" novalidate class="form-validation">
        <input type="hidden" name="Id" value="@Model.Project.Id" />
        <ul class="nav nav-tabs tab-nav-right" role="tablist">
            <li role="presentation" class="active"><a href="#edit-project-details" data-toggle="tab">@L("ProjectDetails")</a></li>
            <li role="presentation"><a href="#edit-project-roles" data-toggle="tab">@L("MemberRole")</a></li>
        </ul>
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane animated fadeIn active" id="edit-project-details">
                <div class="row clearfix" style="margin-top:10px;">
                    <div class="col-sm-12">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input class="form-control" type="text" name="Name" required maxlength="200" minlength="2" value="@Model.Project.Name">
                                <label class="form-label">@L("Name")</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-12">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <textarea type="text" name="Introduction" class="form-control" required maxlength="2000">@Model.Project.Introduction</textarea>
                                <label class="form-label">@L("Introduction")</label>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

            <div role="tabpanel" class="tab-pane animated fadeIn" id="edit-project-roles">
                <div class="row">
                    <div class="col-sm-12 ">
                        @foreach (var role in Model.Roles)
                        {
                        <div class="col-sm-6">
                            @if (Model.Project.MemberRoleId == role.Id)
                            {
                                <input type="radio" checked name="MemberRoleId" value="@role.Id" title="@role.Description" class="filled-in" id="role-edit-@role.Id" />
                            }
                            else
                            {
                                <input type="radio" name="MemberRoleId" value="@role.Id" title="@role.Description" class="filled-in" id="role-edit-@role.Id" />
                            }

                            <label for="role-edit-@role.Id" title="@role.DisplayName">@role.Name</label>
                        </div>
                        }
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>

@await Html.PartialAsync("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")

<script src="~/view-resources/Views/Projects/_EditProjectModal.js" asp-append-version="true"></script>
